package cn.hiapi.core.basic.response;

import cn.hiapi.core.basic.BasicEntity;
import lombok.Setter;
import lombok.Getter;

/**
 * @author AdinZ
 * @date 2020/11/7 11:52
 */
@Setter
@Getter
public class ResponseEntity<T> extends BasicEntity {

    /**
     * 返回状态码
     */
    private int code;

    /**
     * 返回消息
     */
    private String message;
    /**
     * 分页查询时总条数
     */
    private Long total;

    /**
     * 总页数
     */
    private Long totalPage;

    /**
     * 返回数据泛类
     */
    private T data;

    public void setTotal(Long total, int totalPage) {
        this.total = total;
        this.totalPage = (long) totalPage;
    }
}
